﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataControl;
using System.Data;
using System.Text;

namespace ATW.MT.BUS
{
    public class bus_D_Foundation
    {
           DataAccess da = null;
         public bus_D_Foundation()
        {
            da = new DataAccess();
        }
        #region 方法
        //查
         public DataTable Foundation(string name, int page, int pagesize)
         {
             StringBuilder sql = new StringBuilder();
             sql.Append(@"select dfType,dfValue,DFID from D_Foundation");
             if (name != "")
             {
                 sql.Append(" where dfValue like '%" + name + "%'");
             }
             return da.PageSize(sql.ToString(), page, pagesize, "DFID");
         }
        //改
         public int ModifyFoundation(string strType, string strValue, string strDFID)
         {
             StringBuilder sql = new StringBuilder();
             sql.AppendFormat(@"update D_Foundation set dfType='{0}',dfValue='{1}',UpdatedDate=getdate() where DFID='{2}'",
                 strType, strValue, strDFID);
             return da.ExcuteNoQuery(sql.ToString());
         }

         public DataTable SelectFoundation(string strId)
         {
             StringBuilder sql = new StringBuilder();
             sql.AppendFormat(@"select * from  D_Foundation where DFID='" + strId + "'");
             return da.ExecuteDataTable(sql.ToString());
         }
        #endregion

    }
}